import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/publishSheetFlow',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/publishSheetFlow/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/publishSheetFlow',
    method: 'put',
    data
  })
}

export function findById(id) {
  return request({
    url: 'api/publishSheetFlow/findById?id=' + id,
    method: 'get'
  })
}

export function getFlowNodeById(id) {
  return request({
    url: 'api/publishSheetFlow/getFlowNodeById?id=' + id,
    method: 'get'
  })
}

export function getPublishSheetNo() {
  return request({
    url: 'api/publishSheetFlow/getPublishSheetNo',
    method: 'get'
  })
}

export function deployFlow(flowId) {
  return request({
    url: 'api/publishSheetFlow/deploy?flowId=' + flowId,
    method: 'get'
  })
}

export default { add, edit, del, findById, getPublishSheetNo, deployFlow }
